﻿using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Text;

namespace JX.Dapper
{
    /// <summary>
    /// Dapper数据库上下文参数配置类
    /// </summary>
    public class DapperDBContextOptions : IOptions<DapperDBContextOptions>
    {
        /// <summary>
        /// 数据库连接字符串
        /// </summary>
        public string Configuration { get; set; }

        /// <summary>
        /// SQL命令执行超时前的秒数（默认60秒）
        /// </summary>
        public int? CommandTimeout { get; set; } = 60;

        /// <summary>
        /// 数据库提供者类型：sqlserver、mysql
        /// </summary>
        public string ProviderName { get; set; } = "sqlserver";

        /// <summary>
        /// 
        /// </summary>
        DapperDBContextOptions IOptions<DapperDBContextOptions>.Value
        {
            get { return this; }
        }
    }
}
